from django.conf.urls import url
from . import views
from rest_framework_jwt.views import obtain_jwt_token

urlpatterns = [

    url(r'^usernames/(?P<username>\w{5,20})/count/$',views.RegisterUsernameCountAPIView.as_view()),

    url(r'^$',views.RegisterUserAPIView.as_view()),

    #JWT　的登陆认证
    # url(r'^auths/$',obtain_jwt_token),
    url(r'^auths/$',views.UserAuthorizationView.as_view()),

    url(r'^infos/$',views.UserCenterInfoAPIView.as_view()),

    url(r'^emails/$',views.EmailUpdateAPIView .as_view()),

    url(r'^emails/verification$',views.EmailVerificationAPIView.as_view()),

    # url(r'^addresses/$',views.AddressesCreateAPIView.as_view()),

    url(r'^browerhistories/$',views.UserHistoryAPIView.as_view())

]


from .views import AddressViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'addresses',AddressViewSet,base_name='address')
urlpatterns += router.urls

#注册完成之后实现自动登陆











